- EitherT <L, M, A> (K<M, Either<L, A>> runEither)
- Right (A value)
- Left (L value)
- IsRight
- IsLeft
- Lift (Pure<A> pure)
- Lift (Either<L, A> either)
- Lift (Fail<L> fail)
- Lift (K<M, A> monad)
- Lift (K<M, Either<L, A>> monad)
- LiftIO (IO<A> monad)
- LiftIO (IO<Either<L, A>> monad)
- Match <B> (Func<L, B> Left, Func<A, B> Right)
- Match (Action<L> Left, Action<A> Right)
- IfLeft (Func<A> Left)
- IfLeft (Func<L, A> leftMap)
- IfLeft (A rightValue)
- IfLeft (Action<L> Left)
- IfRight (Action<A> Right)
- IfRight (L leftValue)
- IfRight (Func<L> Right)
- IfRight (Func<A, L> rightMap)
- Run ()
- MapT <M1, B> (Func<K<M, Either<L, A>>, K<M1, Either<L, B>>> f)
- MapM <B> (Func<K<M, A>, K<M, B>> f)
- Map <B> (Func<A, B> f)
- Select <B> (Func<A, B> f)
- Bind <B> (Func<A, K<EitherT<L, M>, B>> f)
- Bind <B> (Func<A, Either<L, B>> f)
- Bind <B> (Func<A, EitherT<L, M, B>> f)
- Bind <B> (Func<A, IO<B>> f)
- Bind <B> (Func<A, Pure<B>> f)
- Bind <B> (Func<A, Fail<L>> f)
- SelectMany <B, C> (Func<A, K<EitherT<L, M>, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, EitherT<L, M, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Either<L, B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project)
- SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project)
- ToOption ()
- EitherTExt
- As <L, M, A> (this K<EitherT<L, M>, A> ma)
- Flatten <L, A> (this Task<EitherT<L, IO, A>> tma)
- ToIO <L, A> (this Task<Either<L, A>> ma)
- Flatten <L, M, A> (this EitherT<L, M, EitherT<L, M, A>> mma)
- SelectMany <L, M, A, B, C> ( this K<M, A> ma, Func<A, K<EitherT<L, M>, B>> bind, Func<A, B, C> project)
- SelectMany <L, M, A, B, C> ( this K<M, A> ma, Func<A, EitherT<L, M, B>> bind, Func<A, B, C> project)
- Apply <L, M, A, B> (this EitherT<L, M, Func<A, B>> mf, EitherT<L, M, A> ma)
- Action <L, M, A, B> (this EitherT<L, M, A> ma, EitherT<L, M, B> mb)
- Lefts <L, M, R> (this IEnumerable<EitherT<L, M, R>> self)
- Lefts <L, M, R> (this Seq<EitherT<L, M, R>> self)
- Rights <L, M, R> (this IEnumerable<EitherT<L, M, R>> self)
- Rights <L, M, R> (this Seq<EitherT<L, M, R>> self)
- Partition <L, M, R> (this Seq<EitherT<L, M, R>> self)
- Partition <L, M, R> (this IEnumerable<EitherT<L, M, R>> self)
- EitherT <L, M>
- Right <A> (A value)
- Left <A> (L value)
- lift <A> (Either<L, A> ma)
- lift <A> (Pure<A> ma)
- lift <A> (Fail<L> ma)
- liftIO <A> (IO<A> ma)
- EitherT
- bind <L, M, A, B> (EitherT<L, M, A> ma, Func<A, EitherT<L, M, B>> f)
- map <L, M, A, B> (Func<A, B> f, EitherT<L, M, A> ma)
- Right <L, M, A> (A value)
- Left <L, M, A> (L value)
- apply <L, M, A, B> (EitherT<L, M, Func<A, B>> mf, EitherT<L, M, A> ma)
- action <L, M, A, B> (EitherT<L, M, A> ma, EitherT<L, M, B> mb)
- lift <L, M, A> (Either<L, A> ma)
- lift <L, M, A> (K<M, A> ma)
- lift <L, M, A> (Pure<A> ma)
- lift <L, M, A> (Fail<L> ma)
- liftIO <L, M, A> (IO<A> ma)
- match <L, M, A, B> (EitherT<L, M, A> ma, Func<L, B> Left, Func<A, B> Right)
- EitherT <L, M>
record EitherT <L, M, A> (K<M, Either<L, A>> runEither) Source #
EitherT
monad transformer, which allows for an optional result.
type | M | Given monad trait |
type | L | Left value type |
type | A | Bound value type |
param | runEither | Transducer that represents the transformer operation |
method EitherT<L, M, A> Right (A value) Source #
Lift a pure value into the monad-transformer
param | value | Value to lift |
returns |
|
method EitherT<L, M, A> Left (L value) Source #
Lift a fail value into the monad-transformer
param | value | Value to lift |
returns |
|
method EitherT<L, M, A> Lift (Pure<A> pure) Source #
Lifts a given monad into the transformer
param | pure | Monad to lift |
returns |
|
method EitherT<L, M, A> Lift (Either<L, A> either) Source #
Lifts a given monad into the transformer
param | either | Monad to lift |
returns |
|
method EitherT<L, M, A> Lift (Fail<L> fail) Source #
Lifts a given monad into the transformer
param | fail | Monad to lift |
returns |
|
method EitherT<L, M, A> Lift (K<M, A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method EitherT<L, M, A> Lift (K<M, Either<L, A>> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method EitherT<L, M, A> LiftIO (IO<A> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method EitherT<L, M, A> LiftIO (IO<Either<L, A>> monad) Source #
Lifts a given monad into the transformer
param | monad | Monad to lift |
returns |
|
method K<M, B> Match <B> (Func<L, B> Left, Func<A, B> Right) Source #
Invokes the Right or Left function depending on the state of the Either
type | B | Return type |
param | Left | Function to invoke if in a Left state |
param | Right | Function to invoke if in a Right state |
returns | The return value of the invoked function |
method K<M, Unit> Match (Action<L> Left, Action<A> Right) Source #
Invokes the Right or Left action depending on the state of the Either
param | Right | Action to invoke if in a Right state |
param | Left | Action to invoke if in a Left state |
returns | Unit |
method K<M, A> IfLeft (Func<A> Left) Source #
Executes the Left function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | Left | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method K<M, A> IfLeft (Func<L, A> leftMap) Source #
Executes the leftMap function if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | leftMap | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method K<M, A> IfLeft (A rightValue) Source #
Returns the rightValue if the Either is in a Left state. Returns the Right value if the Either is in a Right state.
param | rightValue | Value to return if in the Left state |
returns | Returns an unwrapped Right value |
method K<M, Unit> IfLeft (Action<L> Left) Source #
Executes the Left action if the Either is in a Left state.
param | Left | Function to generate a Right value if in the Left state |
returns | Returns an unwrapped Right value |
method K<M, Unit> IfRight (Action<A> Right) Source #
Invokes the Right action if the Either is in a Right state, otherwise does nothing
param | Right | Action to invoke |
returns | Unit |
method K<M, L> IfRight (L leftValue) Source #
Returns the leftValue if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | leftValue | Value to return if in the Left state |
returns | Returns an unwrapped Left value |
method K<M, L> IfRight (Func<L> Right) Source #
Returns the result of Right() if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | Right | Function to generate a Left value if in the Right state |
returns | Returns an unwrapped Left value |
method K<M, L> IfRight (Func<A, L> rightMap) Source #
Returns the result of rightMap if the Either is in a Right state. Returns the Left value if the Either is in a Left state.
param | rightMap | Function to generate a Left value if in the Right state |
returns | Returns an unwrapped Left value |
method K<M, Either<L, A>> Run () Source #
Runs the EitherT exposing the outer monad with an inner wrapped Either
method EitherT<L, M1, B> MapT <M1, B> (Func<K<M, Either<L, A>>, K<M1, Either<L, B>>> f) Source #
Maps the bound monad
type | M1 | Target monad type |
type | B | Target bound value type |
param | f | Mapping function |
returns | Mapped monad |
method EitherT<L, M, B> MapM <B> (Func<K<M, A>, K<M, B>> f) Source #
Maps the given monad
param | f | Mapping function |
method EitherT<L, M, B> Map <B> (Func<A, B> f) Source #
Maps the bound value
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method EitherT<L, M, B> Select <B> (Func<A, B> f) Source #
Maps the bound value
type | B | Target bound value type |
param | f | Mapping transducer |
returns |
|
method EitherT<L, M, B> Bind <B> (Func<A, K<EitherT<L, M>, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method EitherT<L, M, B> Bind <B> (Func<A, Either<L, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method EitherT<L, M, B> Bind <B> (Func<A, EitherT<L, M, B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method EitherT<L, M, B> Bind <B> (Func<A, IO<B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method EitherT<L, M, B> Bind <B> (Func<A, Pure<B>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method EitherT<L, M, B> Bind <B> (Func<A, Fail<L>> f) Source #
Monad bind operation
type | B | Target bound value type |
param | f | Mapping function |
returns |
|
method EitherT<L, M, C> SelectMany <B, C> (Func<A, K<EitherT<L, M>, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method EitherT<L, M, C> SelectMany <B, C> (Func<A, EitherT<L, M, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method EitherT<L, M, C> SelectMany <B, C> (Func<A, K<M, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method EitherT<L, M, C> SelectMany <B, C> (Func<A, Either<L, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method EitherT<L, M, C> SelectMany <B, C> (Func<A, Pure<B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method EitherT<L, M, C> SelectMany <B, C> (Func<A, IO<B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
class EitherTExt Source #
Either monad extensions
method EitherT<L, IO, A> Flatten <L, A> (this Task<EitherT<L, IO, A>> tma) Source #
Get the outer task and wrap it up in a new IO within the EitherT IO
method EitherT<L, M, A> Flatten <L, M, A> (this EitherT<L, M, EitherT<L, M, A>> mma) Source #
Monadic join
method EitherT<L, M, C> SelectMany <L, M, A, B, C> ( this K<M, A> ma, Func<A, K<EitherT<L, M>, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method EitherT<L, M, C> SelectMany <L, M, A, B, C> ( this K<M, A> ma, Func<A, EitherT<L, M, B>> bind, Func<A, B, C> project) Source #
Monad bind operation
type | B | Intermediate bound value type |
type | C | Target bound value type |
param | bind | Monadic bind function |
param | project | Projection function |
returns |
|
method EitherT<L, M, B> Apply <L, M, A, B> (this EitherT<L, M, Func<A, B>> mf, EitherT<L, M, A> ma) Source #
Applicative apply
method EitherT<L, M, B> Action <L, M, A, B> (this EitherT<L, M, A> ma, EitherT<L, M, B> mb) Source #
Applicative action
method K<M, Seq<L>> Lefts <L, M, R> (this IEnumerable<EitherT<L, M, R>> self) Source #
Extracts from a list of 'Either' all the 'Left' elements. All the 'Left' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method K<M, Seq<L>> Lefts <L, M, R> (this Seq<EitherT<L, M, R>> self) Source #
Extracts from a list of 'Either' all the 'Left' elements. All the 'Left' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method K<M, Seq<R>> Rights <L, M, R> (this IEnumerable<EitherT<L, M, R>> self) Source #
Extracts from a list of 'Either' all the 'Right' elements. All the 'Right' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method K<M, Seq<R>> Rights <L, M, R> (this Seq<EitherT<L, M, R>> self) Source #
Extracts from a list of 'Either' all the 'Right' elements. All the 'Right' elements are extracted in order.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | An enumerable of L |
method K<M, (Seq<L> Lefts, Seq<R> Rights)> Partition <L, M, R> (this Seq<EitherT<L, M, R>> self) Source #
Partitions a list of 'Either' into two lists. All the 'Left' elements are extracted, in order, to the first component of the output. Similarly the 'Right' elements are extracted to the second component of the output.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | A tuple containing the an enumerable of L and an enumerable of R |
method K<M, (Seq<L> Lefts, Seq<R> Rights)> Partition <L, M, R> (this IEnumerable<EitherT<L, M, R>> self) Source #
Partitions a list of 'Either' into two lists. All the 'Left' elements are extracted, in order, to the first component of the output. Similarly the 'Right' elements are extracted to the second component of the output.
type | L | Left |
type | R | Right |
param | self | Either list |
returns | A tuple containing the an enumerable of L and an enumerable of R |
method EitherT<L, M, B> bind <L, M, A, B> (EitherT<L, M, A> ma, Func<A, EitherT<L, M, B>> f) Source #
method EitherT<L, M, B> map <L, M, A, B> (Func<A, B> f, EitherT<L, M, A> ma) Source #
method EitherT<L, M, B> apply <L, M, A, B> (EitherT<L, M, Func<A, B>> mf, EitherT<L, M, A> ma) Source #